public class StringTest {

    public static void main(String[] args) {
        String str1 = "hello" + " world";
        String str2 = "hello world";

        String str3 = str2 + " java";
        String str4 = "hello world java";

        String str5 = new String("hello world");
        System.out.println(str1 == str2);
        System.out.println(str3 == str4);
        System.out.println(str1 == str5);
    }
}
